package ru.compscicenter.databases.zaikina.common;

import java.io.File;

public class PathGenerator {
    private static final String FULL_OBJECTS = "full_objects";
    private static final String ONE_FIRST_LETTER_HASH = "one_first_letter";
    private static final String TWO_FIRST_LETTERS_HASH = "two_first_letters";
    private static final String THREE_FIRST_LETTERS_HASH = "three_first_letters";
    private static final String FULL_WORD_HASH = "full_words";
    private static final String VERSION = "version";

    private static Integer nodeId;

    public PathGenerator(Integer nodeId) {
        this.nodeId = nodeId;
    }

    public String fullObjectsPath(int version) {
        return nodeId + File.separator + FULL_OBJECTS + version + ".txt";
    }

    public String oneFirstLetterPath(int version) {
        return nodeId + File.separator + ONE_FIRST_LETTER_HASH + version + ".txt";
    }

    public String twoFirstLettersPath(int version) {
        return nodeId + File.separator + TWO_FIRST_LETTERS_HASH + version + ".txt";
    }

    public String threeFirstLettersPath(int version) {
        return nodeId + File.separator + THREE_FIRST_LETTERS_HASH + version + ".txt";
    }

    public String fullWordPath(int version) {
        return nodeId + File.separator + FULL_WORD_HASH + version + ".txt";
    }

    public String versionPath() {
        return nodeId + File.separator + VERSION + ".txt";
    }
}
